package com.cookie.framework;

import android.content.Context;

import com.cookie.framework.bmob.BmobManger;
import com.cookie.framework.cloud.CloudManager;
import com.cookie.framework.helper.NotificationHelper;
import com.cookie.framework.helper.WindowHelper;
import com.cookie.framework.manager.MapManager;
import com.cookie.framework.utils.SpUtils;
import com.uuzuche.lib_zxing.activity.ZXingLibrary;

import org.litepal.LitePal;

/**
 * 项目名:    MeetProject
 * 包名:      com.cookie.framework
 * 文件名:    Framework
 * 创建者:    cookie
 * 创建时间:   2019/12/26 23:26
 * 描述:      Framework入口
 */

public class Framework {

    private volatile static Framework framework;

    private Framework() {

    }

    public static Framework getFramework() {
        if (framework == null) {
            synchronized (Framework.class) {
                if (framework == null) {
                    framework = new Framework();
                }
            }
        }
        return framework;
    }

    public void initFramework(Context context) {
        SpUtils.getInstance().initSp(context);
        BmobManger.getInstance().initBomb(context);
        CloudManager.getInstance().initCloud(context);
        LitePal.initialize(context);
        MapManager.getInstance().initMap(context);
        WindowHelper.getInstance().initWindow(context);
        ZXingLibrary.initDisplayOpinion(context);
        NotificationHelper.getInstance().createChannel(context);
    }
}
